<?php

namespace frontend\models;

use Yii;

/**
 * This is the model class for table "document".
 *
 * @property integer $id
 * @property integer $uid
 * @property string $name
 * @property string $title
 * @property string $category_id
 * @property integer $group_id
 * @property string $description
 * @property string $root
 * @property string $pid
 * @property integer $model_id
 * @property integer $type
 * @property integer $position
 * @property string $link_id
 * @property string $cover_id
 * @property integer $display
 * @property string $deadline
 * @property integer $attach
 * @property string $view
 * @property string $comment
 * @property string $extend
 * @property integer $level
 * @property string $create_time
 * @property string $update_time
 * @property integer $status
 */
class Document extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'document';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['uid', 'category_id', 'group_id', 'root', 'pid', 'model_id', 'type', 'position', 'link_id', 'cover_id', 'display', 'deadline', 'attach', 'view', 'comment', 'extend', 'level', 'create_time', 'update_time', 'status'], 'integer'],
            [['category_id', 'group_id'], 'required'],
            [['name'], 'string', 'max' => 40],
            [['title'], 'string', 'max' => 80],
            [['description'], 'string', 'max' => 140],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid' => 'Uid',
            'name' => 'Name',
            'title' => 'Title',
            'category_id' => 'Category ID',
            'group_id' => 'Group ID',
            'description' => 'Description',
            'root' => 'Root',
            'pid' => 'Pid',
            'model_id' => 'Model ID',
            'type' => 'Type',
            'position' => 'Position',
            'link_id' => 'Link ID',
            'cover_id' => 'Cover ID',
            'display' => 'Display',
            'deadline' => 'Deadline',
            'attach' => 'Attach',
            'view' => 'View',
            'comment' => 'Comment',
            'extend' => 'Extend',
            'level' => 'Level',
            'create_time' => 'Create Time',
            'update_time' => 'Update Time',
            'status' => 'Status',
        ];
    }
}
